﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Vici.Mvc;
using Ss.Model;
namespace web
{
    public class Admin : AdminController
    {
        [View("Admin/login")]
        [Url("Admin/login")]
        public void Run()
        {
            this.ChangeLayout("Master/AdminMaster");
            ViewData["PageTitle"] = "零星科技";
        }
        [Url("Admin/CheckLogin")]
        public bool CheckLogin(string username, string userPwd)
        {
          //  User user = User.ReadFirst("LoginID=@LoginID", "@LoginID", username);
            User user = User.ReadFirst("LoginID=@LoginID", "@LoginID", "shangshuai");
            if (user.LoginID == "shangshuai")
            {
                Session["User"] = user.LoginID;
                Session.User = user;
                Redirect("~/admin/default");
                return true;
            }

            return false;
        }
        [BeforeAction]
        public void IncludeJs()
        {
           
            //IncludeValid();
            IncludeJqForm();
            IncludeCommonJs();
            IncludeIdealForm();
        }
    }
}